module Singly
  class Profiles
    class Service
      include Singly::Endpoint

      endpoint :get, "/profiles/:service", required: [:access_token], optional: [:auth]

      def delete(id=nil)
        if id
          Singly::Profiles::DeleteProfile.new(creds.merge({service: @service, id: id.to_s}))
        else
          Singly::Profiles::DeleteService.new(creds.merge({service: @service}))
        end
      end

      def service=(service)
        @service = service
      end
    end
  end
end